home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / librw / RWBinaryTreeIterator.z / RWBinaryTreeIterator
Encoding:
Text File  |  2002-10-03  |  4.5 KB  |  133 lines

  1.  
  2.  
  3.  
  4. RRRRWWWWBBBBiiiinnnnaaaarrrryyyyTTTTrrrreeeeeeeeIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++))))                          RRRRWWWWBBBBiiiinnnnaaaarrrryyyyTTTTrrrreeeeeeeeIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++))))
  5.  
  6.  
  7.  
  8. NNNNaaaammmmeeee
  9.      RWBinaryTreeIterator - Rogue Wave library class
  10.  
  11. SSSSyyyynnnnooooppppssssiiiissss
  12.               // Smalltalk typedef:
  13.  
  14.  
  15.  
  16.               typedef RWBinaryTreeIterator SortedCollectionIterator;
  17.           #include <rw/bintree.h>
  18.           RWBinaryTree bt;
  19.           RWBinaryTreeIterator iterate(bt);
  20.  
  21.  
  22.  
  23.  
  24. DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn
  25.      Iterator for class RRRRWWWWBBBBiiiinnnnaaaarrrryyyyTTTTrrrreeeeeeee.  Traverses the tree from the "smallest"
  26.      to "largest" element, where "smallest" and "largest" are defined by the
  27.      virtual function ccccoooommmmppppaaaarrrreeeeTTTToooo(((()))).  Note that this approach is generally less
  28.      efficient than using the member function RRRRWWWWBBBBiiiinnnnaaaarrrryyyyTTTTrrrreeeeeeee::::::::aaaappppppppllllyyyy(((()))).  Like all
  29.      Rogue Wave iterators, the "current item" is undefined immediately after
  30.      construction -- you must define it by using ooooppppeeeerrrraaaattttoooorrrr(((()))) or some other
  31.      (valid) operation.  Once the iterator has advanced beyond the end of the
  32.      collection it is no longer valid -- continuing to use it will bring
  33.      undefined results.
  34.  
  35. PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
  36.      None
  37.  
  38. PPPPuuuubbbblllliiiicccc CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrr
  39.               RWBinaryTreeIterator(const RWBinaryTree&);
  40.  
  41.  
  42.      Constructs an iterator for an RRRRWWWWBBBBiiiinnnnaaaarrrryyyyTTTTrrrreeeeeeee.  Immediately after
  43.      construction, the position of the iterator is undefined until positioned.
  44.  
  45. PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr OOOOppppeeeerrrraaaattttoooorrrr
  46.               virtual RWCollectable*
  47.           ooooppppeeeerrrraaaattttoooorrrr()();
  48.  
  49.  
  50.      Redefined from class RRRRWWWWIIIItttteeeerrrraaaattttoooorrrr.  Advances iterator to the next "largest"
  51.      element and returns a pointer to it.  Returns nnnniiiillll when the end of the
  52.      collection is reached.
  53.  
  54. PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
  55.               virtual RWCollectable*
  56.           ffffiiiinnnnddddNNNNeeeexxxxtttt(const RWCollectable* target);
  57.  
  58.  
  59.      Redefined from class RRRRWWWWIIIItttteeeerrrraaaattttoooorrrr.  Moves iterator to the next item which
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. RRRRWWWWBBBBiiiinnnnaaaarrrryyyyTTTTrrrreeeeeeeeIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++))))                          RRRRWWWWBBBBiiiinnnnaaaarrrryyyyTTTTrrrreeeeeeeeIIIItttteeeerrrraaaattttoooorrrr((((3333CCCC++++++++))))
  71.  
  72.  
  73.  
  74.      compares equal to the object pointed to by ttttaaaarrrrggggeeeetttt and returns it.  If no
  75.      item is found, returns nnnniiiillll and the position of the iterator will be
  76.      undefined.
  77.  
  78.               virtual void
  79.           rrrreeeesssseeeetttt();
  80.  
  81.  
  82.      Redefined from class RRRRWWWWIIIItttteeeerrrraaaattttoooorrrr.  Resets iterator to its state at
  83.      construction.
  84.  
  85.               virtual RWCollectable*
  86.           kkkkeeeeyyyy() const;
  87.  
  88.  
  89.      Redefined from class RRRRWWWWIIIItttteeeerrrraaaattttoooorrrr.  Returns the item at the current
  90.      iterator position.
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.